package com.turing.post.datatranfer.util;

import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 卡交易明细
 * 
 * @author zxp
 * @Jan 27, 2013
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "CardTradDetail")
@IdClass(CardTradDetail.class)
public class CardTradDetail implements java.io.Serializable {
 
	private String batchno;// char(6) n
	private String cardno; // char(16) n
	private String transeqno; // char(22) n
	private String trancode;// ;char(2) n
	private Date tradtime;// date n
	private String channelid;// char(2) n
	private BigInteger amount;// number(8) n 0
	private BigInteger balance;// number(8) n
	private String canceltranseqno;// varchar2(22) y
	private String channelseqno;// varchar2(20) y
	private Date channeltrandate;// date y
	private String channelabstract;// varchar2(20) y

	public CardTradDetail() {

	}

	public String getBatchno() {
		return batchno;
	}

	public void setBatchno(String batchno) {
		this.batchno = batchno;
	}

	@Id
	@Column(name = "CARDNO")
	public String getCardno() {
		return cardno;
	}

	public void setCardno(String cardno) {
		this.cardno = cardno;
	}

	@Id
	@Column(name = "TRANSEQNO")
	public String getTranseqno() {
		return transeqno;
	}

	public void setTranseqno(String transeqno) {
		this.transeqno = transeqno;
	}

	@Column(name = "TRANCODE")
	public String getTrancode() {
		return trancode;
	}

	public void setTrancode(String trancode) {
		this.trancode = trancode;
	}

	@Column(name = "TRADTIME")
	public Date getTradtime() {
		return tradtime;
	}

	public void setTradtime(Date tradtime) {
		this.tradtime = tradtime;
	}

	@Column(name = "CHANNELID")
	public String getChannelid() {
		return channelid;
	}

	public void setChannelid(String channelid) {
		this.channelid = channelid;
	}

	@Column(name = "AMOUNT")
	public BigInteger getAmount() {
		return amount;
	}

	public void setAmount(BigInteger amount) {
		this.amount = amount;
	}

	@Column(name = "BALANCE")
	public BigInteger getBalance() {
		return balance;
	}

	public void setBalance(BigInteger balance) {
		this.balance = balance;
	}

	@Column(name = "CANCELTRANSEQNO")
	public String getCanceltranseqno() {
		return canceltranseqno;
	}

	public void setCanceltranseqno(String canceltranseqno) {
		this.canceltranseqno = canceltranseqno;
	}

	@Column(name = "CHANNELSEQNO")
	public String getChannelseqno() {
		return channelseqno;
	}

	public void setChannelseqno(String channelseqno) {
		this.channelseqno = channelseqno;
	}

	@Column(name = "CHANNELTRANDATE")
	public Date getChanneltrandate() {
		return channeltrandate;
	}

	public void setChanneltrandate(Date channeltrandate) {
		this.channeltrandate = channeltrandate;
	}

	@Column(name = "CHANNELABSTRACT")
	public String getChannelabstract() {
		return channelabstract;
	}

	public void setChannelabstract(String channelabstract) {
		this.channelabstract = channelabstract;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((getCardno() == null) ? 0 : getCardno().hashCode());
		result = prime * result
				+ ((getTranseqno() == null) ? 0 : getTranseqno().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final CardTradDetail other = (CardTradDetail) obj;
		if (getCardno() == null) {
			if (other.getCardno() != null)
				return false;
		} else if (!getCardno().equals(other.getCardno()))
			return false;
		if (getTranseqno() == null) {
			if (other.getTranseqno() != null)
				return false;
		} else if (!getTranseqno().equals(other.getTranseqno()))
			return false;
		return true;
	}
}